{include file="public/header"}
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>商家中心</title>
    <link rel="stylesheet" type="text/css" href="__CSS__/tt.css" />
    <link href="/static/admin/css/font-awesome.min.css?v=4.7.0" rel="stylesheet">
    <link href="__JSS__/plugins/layui/css/layui.css" rel="stylesheet">
    <style>
        .hidden {
            display: none !important;
        }

        html,
        body {
            width: 100%;
            background: rgba(238, 238, 238, 1);
            margin:0;
            padding:0;
            word-wrap: break-word;
            word-break: break-all;
        }

        .container{
            padding-top:30px;
            padding-bottom:80px;
        }
        .box{
            width:1200px;
            height:auto;
            background:#fff;
            margin:auto;
            padding-top:50px;
            padding-bottom:80px;
            border-radius:3px;
        }
        .selectBox{
            padding:0 100px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .delete {
            position: absolute;
            bottom: 0;
            width: 100%;
            left: 0;
            height: 24px;
            line-height: 24px;
            text-align: center;
            background: rgba(0, 0, 0, 0.3);
            color: #ffffff;
            font-size: 12px;
        }
        .selectLeft,.selectRight{
            width:440px;
            height:194px;
            box-shadow:0px 2px 10px 0px rgba(0,0,0,0.1);
            border-radius:5px;
            border:1px solid rgba(238,238,238,1);
            border-top:5px solid #0065F0;
            box-sizing: border-box;
        }
        .selectLeft{
            position: relative;
        }
        .line{
            width:1px;
            height:85px;
            background:#E6E7EB;
        }
        .charge{
            color:#0065F0;
            font-size:14px;
            position: absolute;
            top:20px;
            right:30px;
        }
        .priceName{
            color:#333;
            font-size:24px;
            text-align: center;
            margin-top:30px;
            font-weight:500;
        }
        .price{
            font-size:24px;
            color:#0065F0;
            text-align: center;
            font-family:Helvetica;
            margin-top:11px;
        }
        .unit{
            font-size:14px;
            margin-left:6px;
        }
        .longLine{
            /*width:380px;*/
            height:1px;
            background:#EEE;
            margin:30px auto 0;
        }
        .tipsBox{
            height:60px;
            padding:0 97px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size:14px;
            color:#999;
        }
        .line2{
            width:1px;
            height:16px;
            background:#CCC;
        }
        .review{
            text-align: center;
            font-size:24px;
            color:#333;
            font-weight:500;
            margin-top:56px;
        }
        .reviewTip{
            text-align: center;
            color:#0065F0;
            font-size:14px;
            margin-top:19px;
        }
        .titleLine{
            width:4px;
            height:24px;
            background:#0065F0;
            border-radius:3px;
            float:left;
        }
        .title{
            font-size:18px;
            color:#000;
            font-weight:500;
            margin-left:10px;
            float:left;
        }
        .data{
            margin-top:61px;
            padding-left:100px;
        }
        .dataTitle{
            height:24px;
            margin-bottom:31px;
        }
        .dataContent{
            padding-left:25px;
            /*height:34px;*/
            display: flex;
            align-items: center;
            margin-bottom:29px;
        }
        .dataLeft{
            font-size:14px;
            color:#333;
            font-weight:500;
            margin-right:30px;
        }
        .inputt{
            width:520px;
            height:34px;
            border:1px solid #ccc;
            border-radius:3px;
            box-sizing: border-box;
            padding-left:10px;
            outline:none;
        }
        .addPic{
            width:102px;
            height:102px;
        }
        .intro{
            width:520px;
            height:270px;
            border:1px solid #ccc;
            border-radius:3px;
            padding:20px;
            resize: none;
            box-sizing: border-box;
        }
        .txtImg{
            width:100px;
            height:100px;
        }
        .txtt{
            font-size:12px;
            color:#666;
            margin-top:16px;
        }
        .btn{
            margin-left:214px;
            width:130px;
            height:34px;
            line-height:34px;
            background:#0065F0;
            border-radius:3px;
            margin-top:11px;
            text-align:center;
            font-size:12px;
            color:#fff;
        }
        .item4_middle{
            display:flex;
        }
        .add{
            position: relative;
            margin-left:10px;
        }
        .delete{
            width:100%;
            text-align:center;
            position: absolute;
            bottom:0;
            left:0;
            background:rgab(0,0,0,0.4)
        }
        .jianju{
            margin-bottom:60px;
        }
    </style>
</head>

<body>

<header class="wrap3">
    <div class="tt_top3">
        <div class="tt_top33">商家中心</div>
    </div>
</header>
<div>
<div class="container">
    <div class="box">
        <div class="selectBox jianju">
            {if $info.shop_auth == 200}
            <div class="selectLeft">
                <div class="charge" style="cursor:pointer;" {if $data.s_status == 2} onclick="location.href = '/shop/center/recharge'" {else /} onclick="alert('请先进行商家认证！');" {/if}>充值</div>
                <div class="priceName">账户余额</div>
                <div class="price">{$data.s_money}<span class="unit">平台币</span></div>
                <div class="longLine"></div>
                <div class="tipsBox">
                    <div class="leftTip" style="cursor:pointer;" {if $data.s_status == 2} onclick="location.href = '/shop/center/recharge'" {else /} onclick="alert('请先进行商家认证！');" {/if}>充值须知</div>
                    <div class="line2"></div>
                    <div class="rightTip" style="cursor:pointer;" onclick="location.href = '/shop/Center/consumeDetail';">充值明细</div>
                </div>
            </div>
            <!--<div class="line"></div>-->
            {if $data['s_status']==4}
            <div class="selectRight" style="cursor:pointer" onclick="location.href = '/shop/center/approvePage'">
                <div class="review">认证</div>
                <div class="reviewTip">未认证，快去认证吧～</div>
            </div>
            {elseif $data['s_status']==2 /}
            <div class="selectRight" style="cursor:pointer" onclick="location.href = '/shop/center/approve'">
                <div class="review">认证成功</div>
                <div class="reviewTip">查看认证资料～</div>
            </div>
            {elseif $data['s_status']==3 /}
            <div class="selectRight" style="cursor:pointer" onclick="location.href = '/shop/center/approve'">
                <div class="review">认证失败</div>
                <div class="reviewTip">查看认证失败原因～</div>
            </div>
            {else /}
            <div class="selectRight" style="cursor:pointer" onclick="location.href = '/shop/center/approve'">
                <div class="review">认证中</div>
                <div class="reviewTip">查看认证资料～</div>
            </div>
            {/if}
            </div>
    <div class="selectBox">
            <!--<div class="line"></div>-->
            {if $data['s_active_status']==1}
            <div class="selectLeft" style="cursor:pointer" {if $data.s_status == 2} onclick="location.href = '/shop/center/activeAsk'" {else /} onclick="alert('请先进行商家认证！');" {/if}>
                <div class="review">活动任务认证</div>
                <div class="reviewTip">未认证，快去认证吧～</div>
            </div>
            {elseif $data['s_active_status']==2 /}
            <div class="selectLeft" style="cursor:pointer" onclick="location.href = '/shop/center/active_status'">
                <div class="review">活动任务认证成功</div>
                <div class="reviewTip">查看认证资料～</div>
            </div>
            {elseif $data['s_active_status']==3 /}
            <div class="selectLeft" style="cursor:pointer" onclick="location.href = '/shop/center/active_status'">
                <div class="review">活动任务认证失败</div>
                <div class="reviewTip">查看认证失败原因～</div>
            </div>
            {else /}
            <div class="selectLeft" style="cursor:pointer" onclick="location.href = '/shop/center/active_status'">
                <div class="review">活动任务认证中</div>
                <div class="reviewTip">查看认证资料～</div>
            </div>
            {/if}
            {if $data['s_dl_status']==1}
            <div class="selectRight" style="cursor:pointer" onclick="location.href = '/shop/center/unaudited'">
                <div class="review">申请代理商</div>
                <div class="reviewTip">未申请，去申请～</div>
            </div>
            {elseif $data['s_dl_status']==2/}
            <div class="selectRight" style="cursor:pointer" onclick="location.href = '/shop/center/detail'">
                <div class="review">申请代理商</div>
                <div class="reviewTip">申请代理商认证中～</div>
            </div>
            {elseif $data['s_dl_status']==3}
                <div class="selectRight" style="cursor:pointer" onclick="location.href = '/shop/center/detail'">
                    <div class="review">申请代理商</div>
                    <div class="reviewTip">申请代理商审核通过～</div>
                </div>
            {elseif $data['s_dl_status']==4/}
                <div class="selectRight" style="cursor:pointer" onclick="location.href = '/shop/center/unaudited'">
                    <div class="review">申请代理商</div>
                    <div class="reviewTip">申请代理商审核失败～</div>
                </div>
            {/if}
    {else /}
        {if $data['s_active_status']==1}
        <div class="selectLeft" style="cursor:pointer" {if $data.s_status == 2} onclick="location.href = '/shop/center/activeAsk'" {else /} onclick="alert('请先进行商家认证！');" {/if}>
        <div class="review">活动任务认证</div>
        <div class="reviewTip">未认证，快去认证吧～</div>
        </div>
        {elseif $data['s_active_status']==2 /}
        <div class="selectLeft" style="cursor:pointer" onclick="location.href = '/shop/center/active_status'">
            <div class="review">活动任务认证成功</div>
            <div class="reviewTip">查看认证资料～</div>
        </div>
        {elseif $data['s_active_status']==3 /}
        <div class="selectLeft" style="cursor:pointer" onclick="location.href = '/shop/center/active_status'">
            <div class="review">活动任务认证失败</div>
            <div class="reviewTip">查看认证失败原因～</div>
        </div>
        {else /}
        <div class="selectLeft" style="cursor:pointer" onclick="location.href = '/shop/center/active_status'">
            <div class="review">活动任务认证中</div>
            <div class="reviewTip">查看认证资料～</div>
        </div>
        {/if}
        {if $data['s_status']==4}
        <div class="selectRight" style="cursor:pointer" onclick="location.href = '/shop/center/approvePage'">
            <div class="review">认证</div>
            <div class="reviewTip">未认证，快去认证吧～</div>
        </div>
        {elseif $data['s_status']==2 /}
        <div class="selectRight" style="cursor:pointer" onclick="location.href = '/shop/center/approve'">
            <div class="review">认证成功</div>
            <div class="reviewTip">查看认证资料～</div>
        </div>
        {elseif $data['s_status']==3 /}
        <div class="selectRight" style="cursor:pointer" onclick="location.href = '/shop/center/approve'">
            <div class="review">认证失败</div>
            <div class="reviewTip">查看认证失败原因～</div>
        </div>
        {else /}
        <div class="selectRight" style="cursor:pointer" onclick="location.href = '/shop/center/approve'">
            <div class="review">认证中</div>
            <div class="reviewTip">查看认证资料～</div>
        </div>
        {/if}
    {/if}
        </div>
    </div>
<form id="fabutask">
        <div class="data">
            <div class="dataTitle">
                <div class="titleLine"></div>
                <div class="title">基础资料</div>
            </div>
            <div class="dataContent">
                <div class="dataLeft">商家名称</div>
                <input type="text" class="inputt" name="name" value="{$data['s_name']}" minlength="2" maxlength="25">
            </div>
            <div class="dataContent">
                <div class="dataLeft">商家地址</div>
                <select class="inputt sheng_ajax" style="width: 160px;margin-right: 20px;">
                    <option data-id="" value="">请选择省</option>
                    {volist name='sheng' id='p'}
                    <option data-id="{$p.district_id}" {if $data.s_sheng == $p.district_id}selected{/if}>{$p.district}</option>
                    {/volist}
                </select>
                <select class="inputt shi_ajax" style="width: 160px;margin-right: 20px;">
                    <option data-id="" value="">请选择市</option>
                    {volist name='shi' id='s'}
                    <option data-id="{$s.district_id}" {if $data.s_shi == $s.district_id}selected{/if}>{$s.district}</option>
                    {/volist}
                </select>
                <select class="inputt qu_ajax" style="width: 160px;">
                    <option data-id="" value="">请选择区</option>
                    {volist name='qu' id='q'}
                    <option data-id="{$q.district_id}" {if $data.s_qu == $q.district_id}selected{/if}>{$q.district}</option>
                    {/volist}
                </select>
            </div>
            <div class="dataContent">
                <div class="dataLeft">详细地址</div>
                <input type="text" class="inputt" name="s_address" value="{$data['s_address']}">
            </div>
            <div class="dataContent">
                <div class="dataLeft">商家头像</div>
                <input type="file" accept="image/*" id="fileimg" onChange="previewimg(this)" style="display:none;" name ="input_image" >
                <div class="item4_middle"  id="uploader">
                    <div class="add uploadimg">
                        <img src="__IMG__/addpic.png" alt="" class="addPic">
                    </div>
                    <div class="add imgshow {if $data['s_thumb']==''}hidden {/if}">
                        <img id="imgsrc" src="{$data['s_thumb']}" alt="" class="addPic">
                        <div class="delete" onclick="delimg();">
                            删除
                        </div>
                    </div>
                </div>
            </div>
            <div class="dataContent">
                <div class="dataLeft">商家图片</div>
                <input type="file" accept="image/*" id="fileimg1" onChange="previewimg1(this)" style="display:none;" name ="input_image1" >
                <div class="item4_middle"  id="uploader1">
                    <div class="add uploadimg1">
                        <img src="__IMG__/addpic.png" alt="" class="addPic">
                    </div>
                    <div class="add imgshow1 {if $data['s_image']==''}hidden {/if}">
                        <img id="imgsrc1" src="{$data.s_image}" alt="" class="addPic">
                        <div class="delete" onclick="delimgs();">
                            删除
                        </div>
                    </div>
                </div>
            </div>
            <div class="dataContent">
                <div class="dataLeft">商家简介</div>
                    <div id="LAY_editor" style="width:750px;">
                        <p>{$data['s_jianjie']}</p>
                    </div>
            </div>
            <style>
                .button-group {
                    position: absolute;
                    bottom: 20px;
                    right: 20px;
                    font-size: 12px;
                    padding: 10px;
                }

                .button-group .button {
                    height: 28px;
                    line-height: 28px;
                    background-color: #0D9BF2;
                    color: #FFF;
                    border: 0;
                    outline: none;
                    padding-left: 5px;
                    padding-right: 5px;
                    border-radius: 3px;
                    margin-bottom: 4px;
                    cursor: pointer;
                }
                .button-group .inputtext {
                    height: 26px;
                    line-height: 26px;
                    border: 1px;
                    outline: none;
                    padding-left: 5px;
                    padding-right: 5px;
                    border-radius: 3px;
                    margin-bottom: 4px;
                    cursor: pointer;
                }
                /*
               .tip {
                   position: absolute;
                   bottom: 30px;
                   right: 10px;
                   background-color: #FFF;
                   text-align: center;
                   border: 1px solid #ccc;
                   line-height: 30px;
                   border-radius: 3px;
                   padding: 0 5px;
                   font-size: 12px;
               }
               */
                #tip {
                    background-color: #fff;
                    padding-left: 10px;
                    padding-right: 10px;
                    position: absolute;
                    font-size: 12px;
                    right: 10px;
                    top: 20px;
                    border-radius: 3px;
                    border: 1px solid #ccc;
                    line-height: 30px;
                }

                /*
                #tip input[type='button'] {
                    margin-top: 10px;
                    margin-bottom: 10px;
                    background-color: #0D9BF2;
                    height: 30px;
                    text-align: center;
                    line-height: 30px;
                    color: #fff;
                    font-size: 12px;
                    border-radius: 3px;
                    outline: none;
                    border: 0;
                }
                */
                .amap-info-content {
                    font-size: 12px;
                }

                #myPageTop {
                    position: relative;
                    top: -120px;
                    right: 10px;
                    background: #fff none repeat scroll 0 0;
                    border: 1px solid #ccc;
                    margin: 10px auto;
                    padding:6px;
                    font-family: "Microsoft Yahei", "微软雅黑", "Pinghei";
                    font-size: 14px;
                }
                #myPageTop label {
                    margin: 0 20px 0 0;
                    color: #666666;
                    font-weight: normal;
                }
                #myPageTop input {
                    width: 170px;
                }
                #myPageTop .column2{
                    padding-left: 25px;
                }
                /*.amap-marker,.amap_lib_placeSearch_poi{*/
                    /*!*不显示定位点标签，因为点击没法应*!*/
                    /*display: none;!important;*/
                /*}*/
            </style>
            <div class="dataContent">
                <div class="dataLeft">经纬度</div>
                <div id="container" style="width: 750px;height: 300px;float: right"></div>
                <div id="myPageTop">
                    <table>
                        <tr>
                            <td>
                                <label>请输入关键字：</label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <input id="tipinput"/>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        <div class="btn">保存</div>
        </div>
  </div>
</div>
    <input type="hidden" name="task_image" id="task_image" value="" /><!--为1没传图  为2已传图-->
    <input type="hidden" name="task_image1" id="task_image1" value="" /><!--为1没传图  为2已传图-->
    <input type="hidden" name="s_sheng" id="s_sheng" value="{$data.s_sheng}" /><!--省市区-->
    <input type="hidden" name="s_shi" id="s_shi" value="{$data.s_shi}" /><!--省市区-->
    <input type="hidden" name="s_qu" id="s_qu" value="{$data.s_qu}" /><!--省市区-->
    <input type="hidden" name="s_lat" id="s_lat" value="{$data.s_lat}" /><!--经度-->
    <input type="hidden" name="s_lon" id="s_lon" value="{$data.s_lon}" /><!--纬度-->
</form>
</body>
{include file="public/footer"}
<script type="text/javascript" src="__JSS__/plugins/layui/layui.all.js"></script>
<script type="text/javascript" src="__JS__/wk.js"></script>
<script type="text/javascript" src="__JS__/webuploader/webuploader.js"></script>
<script src="__JSS__/plugins/wangEditor-3.1.1/release/wangEditor.js" ></script>
<script src="__SCRIPT__/common.js" ></script>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=3108d268226b46915b5faa028a004245&plugin=AMap.Autocomplete,AMap.PlaceSearch"></script>
<script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
<script>
    var editor = wk.wang({elem:'#LAY_editor',url:"{:url('shop/upload/wangUpload')}"});
    $('.uploadimg').click(function () {
        $('#fileimg').click();
    });
    $('.uploadimg1').click(function () {
        $('#fileimg1').click();
    });
    function delimg(){
        $('.imgshow').addClass('hidden');
        $('#task_image').val('');
    }
    function delimgs(){
        $('.imgshow1').addClass('hidden');
        $('#task_image1').val('');
    }
    function previewimg(obj){
        var src = window.URL.createObjectURL(obj.files[0]);
        $('#imgsrc').attr('src',src);
        $('.imgshow').removeClass('hidden');
        uploadImageCommon('fabutask','task_image');
    }
    function previewimg1(obj){
        var src = window.URL.createObjectURL(obj.files[0]);
        $('#imgsrc1').attr('src',src);
        $('.imgshow1').removeClass('hidden');
        uploadImageCommon1('fabutask','task_image1');
    }
    $('.btn').click(function () {
//        var formData = new FormData($( "#fabutask" )[0]);//addForm是表单的id，不是input file的
//        formData.append("task_content", editor.txt.html());
//        formData.append("task_share_content", editor2.txt.html());
//        var repeatSubmit = $('#repeatSubmit').val();
//        if(repeatSubmit == 2){
//            alert('请勿重复提交！');
//            return false;
//        }else{
//            var submitInfo = formCheck();
//            if(submitInfo.status == 200){
//                $('#repeatSubmit').val(2);
        var pid = $('#s_sheng').val();
        var sid = $('#s_shi').val();
        var qid = $('#s_qu').val();
        var lat = $('#s_lat').val();
        var lon = $('#s_lon').val();
        if(!lat || !lon){
            alert('请点击选择经纬度');
            return false;
        }
        if(!pid || !sid || !qid){
            alert('地址不能为空');
            return false;
        }else{
            var formData = $( "#fabutask" ).serialize();
            var task_content = editor.txt.html();
//                var task_share_content = editor2.txt.html();
            formData += '&jianjie='+task_content;
            $.ajax({
                url: '/shop/Center/centerPage',
                data: formData,
                type: 'POST',
                dataType: 'JSON',
                success: function (returnData) {
                    alert(returnData.msg);
                    if(returnData.code == 200){
                        window.location.reload();
//                            window.location.href = '/shop/Center/centerPage';
//                            return true;
                    }
                },
                error: function () {
                    alert('服务器错误，请刷新重试！');
                }
            })
        }
//        }
    });
</script>
</html>
<script>
    $('.sheng_ajax').change(function () {
        var pid = $('.sheng_ajax option:selected').attr('data-id');
        $('#s_sheng').val(pid);
        $('#s_shi').val('');
        $('#s_qu').val('');
        //
        $(".shi_ajax").empty();
        $(".qu_ajax").empty();
        if(pid == ''){
            $(".shi_ajax").append('<option data-id="" value="">请选择市</option>');
            $(".qu_ajax").append('<option data-id="" value="">请选择区</option>');
            $('.shi_ajax').val('');
            $('.qu_ajax').val('');
        }else {
            $.ajax({
                url: '/shop/Task/getAreaByType',
                data: 'type=2&id='+pid,
                type: 'POST',
                dataType: 'JSON',
                success: function (returnData) {
                    $(".shi_ajax").empty();
                    $(".qu_ajax").empty();
                    $(".shi_ajax").append('<option data-id="" value="">请选择市</option>');
                    $(".qu_ajax").append('<option data-id="" value="">请选择区</option>');
                    var datas = returnData.msg;
                    $.each(datas,function(key,v){
                        $(".shi_ajax").append('<option data-id="'+v.district_id+'">'+v.district+'</option>');
                    });
                },
                error: function () {
                    alert('ajax error，请刷新重试');
                }
            })
        }
    });
    $('.shi_ajax').change(function () {
        var pid = $('.shi_ajax option:selected').attr('data-id');
        $('#s_shi').val(pid);
        $('#s_qu').val('');
        //
        $(".qu_ajax").empty();
        if(pid == ''){
            $('.qu_ajax').val('');
            $(".qu_ajax").append('<option data-id="" value="">请选择区</option>');
        }else {
            $.ajax({
                url: '/shop/Task/getAreaByType',
                data: 'type=3&id='+pid,
                type: 'POST',
                dataType: 'JSON',
                success: function (returnData) {
                    $(".qu_ajax").empty();
                    $(".qu_ajax").append('<option data-id="" value="">请选择区</option>');
                    var datas = returnData.msg;
                    $.each(datas,function(key,v){
                        $(".qu_ajax").append('<option data-id="'+v.district_id+'">'+v.district+'</option>');
                    });
                },
                error: function () {
                    alert('ajax error，请刷新重试');
                }
            })
        }
    });

    $('.qu_ajax').change(function () {
        var pid = $('.qu_ajax option:selected').attr('data-id');
        $('#s_qu').val(pid);
    });
</script>
<script>
    //地图加载
    var map = new AMap.Map("container", {
        resizeEnable: true
    });
    //输入提示
    var autoOptions = {
        input: "tipinput"
    };
    var auto = new AMap.Autocomplete(autoOptions);
    var placeSearch = new AMap.PlaceSearch({
        map: map
    });  //构造地点查询类
    AMap.event.addListener(auto, "select", select);//注册监听，当选中某条记录时会触发
    function select(e) {
        placeSearch.setCity(e.poi.adcode);
        placeSearch.search(e.poi.name);  //关键字查询查询
        var lng = e.poi.location.lng;   //获取经度
        var lat = e.poi.location.lat;
        document.getElementById("s_lon").value = lng;
        document.getElementById("s_lat").value = lat;
    }


    //为地图注册click事件获取鼠标点击出的经纬度坐标
    map.on('click', function(e) {
//        document.getElementById("lnglat").value = e.lnglat.getLng() + ',' + e.lnglat.getLat();
        document.getElementById("s_lon").value = e.lnglat.getLng();
        document.getElementById("s_lat").value = e.lnglat.getLat();
    });

    AMap.event.addListener(placeSearch, "markerClick", addasd);
    function addasd(e) {
//        $('input[name=activity_address]').val(e.data.pname+e.data.cityname+e.data.adname+e.data.name);
        document.getElementById("s_lon").value = e.data.location.lng;
        document.getElementById("s_lat").value = e.data.location.lat;
    }
</script>
<script type="text/javascript">
    function dingweijw() {
        //确保准确，先定一次
        var sheng = $('.sheng_ajax option:selected').text();
        var shi = $('.shi_ajax option:selected').text();
        var qu = $('.qu_ajax option:selected').text();
        var add = $('input[name="s_address"]').val();
        var map = new AMap.Map("container", {
            resizeEnable: true
        });
        alert(shi + qu + add)
        var geocoder;
        if(!geocoder){
            geocoder = new AMap.Geocoder({
                city: "010", //城市设为北京，默认：“全国”
            });
        }
        geocoder.getLocation(shi + qu + add, function(status, result) {
            if (status === 'complete'&&result.geocodes.length) {
                var lnglat = result.geocodes[0].location;
                alert(lnglat)
//                $('#latlon').val(lnglat);
            }else{
//                $('#latlon').val('');
                alert(JSON.stringify(result))
            }
        });
    }

</script>